package com.yylc.cscore.integration;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;

/**
 * @author xiangnan
 * date 2018/5/14
 */
@Component
public class ServiceClient {
    private static final Logger logger = LogManager.getLogger();

    <T> T handle(Callback<T> callback) {
        try {
            return callback.callback();
        } catch (Exception e) {
            logger.error("调用外部接口异常, e={}", e.getMessage());
            return null;
        }
    }

}
